package com.ywger.web.controller;

import com.ywger.service.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * @author chenmeng
 * @date 2021-11-13 20:20
 * @desc
 */
@Api(tags = "工具")
@RestController
@RequestMapping("/random")
public class RandomEnsController {

    @GetMapping("/ensName")
    @ApiOperation("生成ENS名称")
    public Result randomENs(@RequestParam String ensPrefix,@RequestParam int number){
        List<String> list = new ArrayList<>();
        for (int i = 1; i <= number; i++) {
            list.add(ensPrefix+i);
        }
        return Result.ofSuccess(list);
    }

}
